package cn.t.vo.order;

import lombok.Data;
import org.springframework.util.ObjectUtils;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author l
 */
@Data
public class UpdateOrderGoodsVO implements Serializable {

    /**
     * 领用明细ID
     */
    private Long sid;

    /**
     * sku
     */
    @NotBlank(message = "sku不能为空")
    private String skuCode;

    /**
     * 领用数量
     */
    @NotNull(message = "领用数量不能为空")
    @Min(value = 1, message = "领用数量不能小于1")
    private Integer qty;

    /**
     * 货道号
     */
    @NotNull(message = "货道号不能为空")
    private Integer cargowayNo;

    public String getSkuCode() {
        if (ObjectUtils.isEmpty(skuCode)){
            return skuCode;
        }
        return skuCode.trim();
    }
}
